<?php
	//FUNCTIONS FOR GENERAL USE

    /**
	 * Exception handler
	 *
	 * @param string $exception caught exception
	*/		
	function handle_exception($exception)
	{
        echo "Caught exception: {$exception->getMessage( )}\n";
    }
	
    /**
	 * Handles messages sent from trigger_error() function
	 *
	 * @param string $errno error code
	 * @param string $error_string error string
	 * @param string $filename file name, where the error occured
	 * @param string $line line in the file, where the error occured
	 * @param string $symbols depricated
	*/		
    function errorMessageHandler($errno, $error_string, $filename, $line, $symbols)
	{
		$error = new Errors();
		$error->setError($errno, $error_string, $filename, $line);
	}
	
    /**
	 * Throws an error to Errors class
	 *
	 * @param string $error_type error type
	 * @param string $error_msg error message
	*/		
	function ThrowError($error_type, $error_msg)
	{	
  		debug_backtrace();

 		$bt = debug_backtrace();
 		$xbt = $bt[0];
		
		$error = new Errors();
		$error_msg = "</br>".$error_msg;
		$error->SetError($error_type, $error_msg, $xbt['file'], $xbt['line']);		
	}

?>